From c3ec9999cbd5d272485f693a547b5fe0da781e2d Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Tue, 24 Jun 2014 22:09:23 -0700 Subject: [PATCH] Ignore \r in output matching Windows occasionally has \r\n while everywhere else has \n. Instead of worrying about the difference, just replace all instances of \r with nothing and rely on matching against \n. --- tests/support/mod.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/support/mod.rs b/tests/support/mod.rs index b8bc51142..8b3c296e0 100644 --- a/tests/support/mod.rs +++ b/tests/support/mod.rs @@ -249,7 +249,9 @@ impl Execs { match str::from_utf8(actual) { None => Err(format!("{} was not utf8 encoded", description)), Some(actual) => { - ham::expect(actual == out, + // Let's not deal with \r\n vs \n on windows... + let actual = actual.replace("\r", ""); + ham::expect(actual.as_slice() == out, format!("{} was:\n\ `{}`\n\n\ expected:\n\ -- 2.30.2